import React from 'react'
import { Tabs } from 'antd'
import style from './index.module.less'
import { hospitalAdminUserContext } from './context'
import store from './hooks/index'
// import CityComponents from './components/cityComponent/top'
// import HospitalComponents from './components/hospitalComponent/top'
// import InpatientWardComponents from './components/inpatientWardComponent/top'

import CityModal from './components/cityComponent/modal'

export default () => {
  const storeData = store()

  // 此处暂时模拟用户信息
  // const data = 111
  // const arr = [
  //   { key: '20', children: <CityComponents />, label: '市级管理员' },
  //   { key: '30', children: <HospitalComponents />, label: '医院管理员' },
  //   { key: '40', children: <InpatientWardComponents />, label: '病区管理员' },
  // ]
  // const filterArr = arr.filter((item) => Number(item.key) < data)

  return (
    <hospitalAdminUserContext.Provider value={storeData}>
      <div className={style.hospitalAdminUserBox}>
        <div className={style.center}>
          <Tabs
            activeKey={storeData.topConfigData.tabsKey}
            onChange={storeData.topConfigData.changeTabs}
            items={storeData.topConfigData.filterArr}
          />
        </div>
        <CityModal />
      </div>
    </hospitalAdminUserContext.Provider>
  )
}
